package com.hrhx.servlet;

import java.io.IOException;
import java.net.URLDecoder;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import com.hrhx.util.StringUtil;

@WebServlet(name = "GetUrlParameterServlet", urlPatterns = { "/GetUrlParameter" }, loadOnStartup = 1)
public class GetUrlParameterServlet extends HttpServlet{
	
	private static final long serialVersionUID = -8043045170221283758L;

	public void doGet(HttpServletRequest request, HttpServletResponse response)
		throws ServletException, IOException {
		this.doPost(request, response);
	}
	
	public void doPost(HttpServletRequest request, HttpServletResponse response)
		throws ServletException, IOException {
		String category = request.getParameter("Category");
		String value = request.getParameter("value");
		String seriesName = request.getParameter("SeriesName");
		StringUtil.outPageByHtml(response, "category:"+URLDecoder.decode(category,"UTF-8")+",value:"+value+",seriesName:"+URLDecoder.decode(seriesName,"UTF-8"));
	}
}
